home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / ispell-3.1.18bin / interfaces / guispell-1.1 / rexx / ced / wordspell.ced < prev    next >
Text File  |  1995-09-21  |  2KB  |  62 lines

  1. /*
  2.  *  WordSpell.ced ... ARexx Program to spell check a word while in CED!
  3.  *  Requires ISpell version 2.1ljr (or later) with ARexx Server mode.
  4.  *  Started: LJR  12/19/89
  5.  *  Updated for CED v2.0: LJR  Tue Jan 23 03:11:24 1990
  6.  *  Updated for OS 2.04: LJR  Sat Nov 23 17:40:36 1991
  7.  *  Updated for IGadSpell: LJR  Sun Dec  8 17:01:41 1991
  8.  *  Reworked for GUISpell public release: Thu Mar 26 02:12:39 1992 LJR
  9.  *  Copyright © 1989, 1990, 1991, 1992  Loren J. Rittle
  10.  *  Use as you will, just document your changes and keep my copyright
  11.  *  notice intact.
  12.  *
  13.  *  Loren J. Rittle
  14.  *  rittle@comm.mot.com
  15.  */
  16.  
  17. options results
  18.  
  19. if ~show(ports, 'IRexxSpell') then
  20.   do
  21.     address command 'run <nil: >nil: ispell -r >nil: <nil:'
  22.     address command waitforport 'IRexxSpell'
  23.   end
  24.  
  25. status 87; bytepos = result;
  26. status 57; linepos = result;
  27. status 55; line = result;
  28. parse var line curline '0a'x
  29.  
  30. curpos = 0
  31. do forever
  32.   curpos=pos('09'x, curline, curpos+1)
  33.   if curpos == 0 then break
  34.   curline = overlay(' ', curline, curpos)
  35. end
  36.  
  37. do i = 1 to words(curline)
  38.     if wordindex(curline, i)-1 > bytepos then
  39.   break
  40.   end
  41.  
  42. item = compress( word( curline, i-1 ), ' ~`,./<>?;:"[]{}!@#$%^&*()+|=\' )
  43.  
  44. if item = '' then exit
  45.  
  46. address 'IRexxSpell' quickcheck item
  47. if result = 'bad' then do
  48.     if ~show(ports, 'GUISpell') then
  49.       do
  50.         address command 'run <nil: >nil: GUISpell <nil: >nil:'
  51.         address command waitforport 'GUISpell' 
  52.       end
  53.     if show(ports, 'GUISpell') then
  54.       do
  55.     address 'GUISpell' checkcallbackhook 'rexx:ced/WordSpellCallBack.rexx' bytepos linepos item
  56.         address 'GUISpell' check item
  57.       end
  58.     else
  59.       address 'PingServer' beep
  60.   end
  61. exit
  62.